<!doctype html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<title>(ST)商城专业化管理系统</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link rel="shortcut icon" href="images/favicon.ico" />
<link href="css/layout.css" rel="stylesheet" type="text/css" />
<link href="css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="js/js.js"></script>
<script src="assets/layer/layer.js" type="text/javascript"></script>
</head>
<style>
.ibar {
	display: none;
}
</style>
<body class="login-bg" onkeydown="on_return();">
	<div class="main ">
		<!--登录-->
		<div class="login-dom login-max">
			<div class="logo text-center">
				<a href="#"> <img src="images/logo2.png" width="180px"
					height="180px">
				</a>
			</div>
			<div class="login container " id="login">
				<p class="text-big text-center logo-color">同一个账号，连接一切</p>
				<p class=" text-center margin-small-top logo-color text-small">
					控制台 | 云平台 | 论坛 | 云市场</p>
				<div class="login-form" method="post" autocomplete="off">
					<div class="login-box border text-small" id="box">
						<div class="name border-bottom">
							<input type="text" placeholder="手机 / 邮箱 / 某某账号" id="username"
								nullmsg="请填写帐号信息">
						</div>
						<div class="pwd">
							<input type="password" placeholder="密码" id="password"
								nullmsg="请填写帐号密码">
						</div>
						<div class="ljx">
							<span></span>
						</div>
						<div class="col-xs-8">
							<div class="checkbox icheck">
								<label> <input type="checkbox" id="rememberid">
									<span style="color: #bac9d2;">记住我</span>
								</label>
							</div>
						</div>
					</div>
					<input type="hidden" name="formhash" value="5abb5d21" /> <input
						id="ahha" type="submit" class="btn text-center login-btn"
						value="立即登录" onclick="login()">

				</div>
				<div class="forget">
					<a href="repassword.html" class="forget-pwd text-small fl"></a><a
						href="register.html" class="forget-new text-small fr"
						id="forget-new">创建一个新账号</a>
				</div>
			</div>
		</div>

		<div class="footer text-center text-small ie">
			Copyright 2019 CGB1908 SOULTEAM研发 <a href="#" target="_blank"></a> <span
				class="margin-left margin-right"></span>
		</div>
		<div class="popupDom">
			<div class="popup text-default"></div>
		</div>
	</div>
</body>
<script type="text/javascript" src="js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
	function popup_msg(msg) {
		$(".popup").html("" + msg + "");
		$(".popupDom").animate({
			"top" : "0px"
		}, 400);
		setTimeout(function() {
			$(".popupDom").animate({
				"top" : "-40px"
			}, 400);
		}, 2000);
	}

	/*动画（注册）*/
	$(document).ready(function(e) {
		// $("input[name=username]").focus();
		// $('.login-form').Validform({
		// 	ajaxPost: true,
		// 	tiptype: function(msg) {
		// 		if (msg) popup_msg('' + msg + '');
		// 	},
		// 	callback: function(ret) {
		// 		popup_msg('' + ret.info + '');
		// 		if (ret.status == 1) {
		// 			if (ret.uc_user_synlogin) {
		// 				$("body").append(ret.uc_user_synlogin);
		// 			}
		// 			setTimeout("window.location='" + ret.url + "'", 2000);
		// 		}
		// 	}
		// })

	});
	function login() {
		if ($("#username").val() == "") {
			layer.alert("用户名不能为空", {
				title : '提示框',
				icon : 2,
			});
			return;
		}
		if ($("#password").val() == "") {
			layer.alert("用户名不能为空", {
				title : "提示框",
				icon : 2,
			});
			return;
		}
		console.log(1);
		var params = {
			username : $("#username").val(),
			password : $("#password").val(),
			isRememberMe : $("#rememberid").prop("checked"),
		}
		var url = "/LogIn";
		console.log("params", params);
		$.getJSON(url, params, function(result) {
			console.log(result);
			if (result.state == 1) {
				//debugger;
				location.href="index?username="+$("#username").val()+"&t="+Math.random();
				//location.href = "index?t=" + Math.random();
			} else {
				layer.alert(result.message, {
					title : '提示框',
					icon : 2,
				});
			}
			return false;//防止刷新时重复提交
		});
	}
	function on_return(){
		 if(window.event.keyCode == 13){
		  if (document.all('ahha')!=null){
		   document.all('ahha').click();
		   }
		 }
		 }
</script>

</html>